package com.yinkgh.interfacedemo;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yinkgh.mybatis.view.BondTrialInfoView;

public class Main {
	
	public static void main(String[] args) throws ParseException {
		
		SimpleDateFormat ssddff = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss aa", Locale.ENGLISH);
		String str = "Nov 24, 2016 2:54:26 PM"; 
		Date date = ssddff.parse(str);
		System.out.println(date);
		
		//TODO 日期转换异常  英文格式的如何转换
		/*
		 * 参考博客
		 * http://www.cnblogs.com/sallet/p/4108493.html
		 * http://yidao620c.iteye.com/blog/2036853
		 * http://blog.csdn.net/u011113654/article/details/50470893
		 * 重点查看这个
		 * http://www.oschina.net/question/113299_90140
		 * 
		 */
		
		
		String data = "[{\"id\":2112,\"baseId\":25,\"issueAmount\":121,\"approvalNum\":\"实打实的\",\"approvalTime\":\"Nov 24, 2016 2:54:26 PM\",\"checkState\":\"32423\",\"acceptTime\":\"Nov 22, 2016 2:54:55 PM\",\"firstFeedbackTime\":\"Nov 10, 2016 2:55:07 PM\",\"firstReplayTime\":\"Dec 2, 2016 2:55:10 PM\",\"secondFeedbackTime\":\"Nov 24, 2016 2:55:15 PM\",\"secondReplayTime\":\"Nov 25, 2016 2:55:20 PM\",\"expertTime\":\"Nov 18, 2016 2:55:56 PM\",\"preAuditTime\":\"Nov 11, 2016 2:55:59 PM\",\"remark\":\"222232\",\"state\":1,\"bondName\":\"今年高考结果很快就会高科技更何况\",\"bondCode\":\"发士大夫打算\",\"issueWay\":\"公募\",\"issuerName\":\"3\",\"issuerSRB\":\"北京证监局\",\"trem\":2121,\"stockCode\":\"2121\",\"issuerBusiness\":\"333\",\"issuerIndustry\":\"食品\",\"issuerNature\":\"21\",\"issuerContactWay\":\"12121\",\"underwriterName\":\"33\",\"underwriterCharge\":\"231\",\"trusteeName\":\"2121\",\"issuerRating\":\"AA\",\"rating\":\"二级\",\"creditMeasures\":\"2121\",\"accountingName\":\"2121\",\"accountingSignatory\":\"21\",\"lawName\":\"2121\",\"lawSignatory\":\"2121\",\"ratingAgencyName\":\"2121\",\"ratingAgencyCharge\":\"2121\",\"beIssueAmount\":1221},{\"id\":2371,\"baseId\":251,\"issueAmount\":0,\"approvalNum\":\"\",\"checkState\":\"未通过\",\"remark\":\"\",\"state\":1}]";
		JSON.DEFFAULT_DATE_FORMAT = "MMM dd, yyyy hh:mm:ss aa";
		JSON.defaultLocale = Locale.ENGLISH;
		List<BondTrialInfoView> bondTrialInfoViews = JSONArray.parseArray(data, BondTrialInfoView.class);
	
	
		/*DefaultJSONParser parser = new DefaultJSONParser((String) data, ParserConfig.getGlobalInstance()); 
        parser.setDateFormat("yyyyMMddHHmmss"); 
        TradeRequestJsonMsg reqMsgJson = parser.parseObject(TradeRequestJsonMsg.class); 
        JSON.handleResovleTask(parser, reqMsgJson); 
        parser.close(); */
	}
}
